package com.alpaak.common.utils;

import java.util.concurrent.ThreadLocalRandom;

/**
 * @ClassName: ThreadTokenUtil 
 * @Description: 线程令牌工具类
 * @author: FengWenJu
 * @date: 2017年11月7日 下午1:15:45
 */
public class ThreadTokenUtil {

	/**
	 * @Title: getThreadToken  
	 * @Description: 产生一个线程令牌号
	 * @param @return     
	 * @return String    
	 * @throws
	 */
	public static String getThreadToken(){
		String token = "";
		long head = System.currentTimeMillis()%86400000;
		long body = Thread.currentThread().getId();
		long foot = ThreadLocalRandom.current().nextInt(1000);
		token = head + "_" + body + "_" + foot;
		return token;
	} 
	
	
	public static void main(String[] args) {
		String token = getThreadToken();
		System.out.println("Test token:"+token);
	}
}
